package com.liseen.events
{
	import flash.events.Event;
	/**
	 * 通讯体事件
	 * @author Liseen
	 * 
	 */	
	public class SmartSocketEvent extends Event
	{
		public static const CONNECT:String = "smartSocket_connect";
		public static const CLOSE:String = "smartSocket_close";
		public static const SECURITY_ERROR:String = "smartSocket_securityError";
		public static const IO_ERROR:String = "smartSocket_IoError";
		public static const RECEIVED:String = "smartSocket_received";
		
		private var _data:Object;
		
		public function SmartSocketEvent(type:String,data:Object=null, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			this._data = data;
		}
		
		public function get data():Object
		{
			return this._data;
		}
		
		public override function clone():Event 
		{ 
			return new SmartSocketEvent(type,_data, bubbles, cancelable);
		} 
		
		public override function toString():String 
		{ 
			return formatToString("SmartSocketEvent", "type", "bubbles", "cancelable", "eventPhase"); 
		}
	}
}